﻿<%@ Page Language="C#" MasterPageFile="~/CRM.Master" AutoEventWireup="true" CodeBehind="GAgendaCompromisso.aspx.cs"
    Inherits="crm.aplicacao.CRMSystem.GAgendaCompromisso" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ext:GridPanel ID="GridAgendaCompromisso" runat="server" Title="Gerência de Compromisso"
        AutoScroll="true" AutoExpandColumn="titulo" Height="600">
        <Store>
            <ext:Store ID="strAgendaCompromisso" runat="server">
                <Reader>
                    <ext:ArrayReader>
                        <Fields>
                            <ext:RecordField Name="idagendadecompromisso" />
                            <ext:RecordField Name="titulo" />
                            <ext:RecordField Name="data" />
                            <ext:RecordField Name="horainicio" />
                            <ext:RecordField Name="horafim" />
                            <ext:RecordField Name="descricao" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
        </Store>
        <TopBar>
            <ext:Toolbar ID="ToolbarAgendaCompromisso" runat="server" AutoWidth="true">
                <Items>
                    <ext:Button ID="btNovoAgendaCompromisso" runat="server" Text="Novo" Icon="Add">
                        <Listeners>
                            <Click Handler="#{WindowsNovoAgendaCompromisso}.show()" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="btEditarAgendaCompromisso" runat="server" Text="Editar" Icon="PageWhiteEdit">
                        <Listeners>
                            <Click Handler="alert('Ainda não Está Editando')" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="btRemoverAgendaCompromisso" runat="server" Text="Remover" Icon="Delete">
                        <Listeners>
                            <Click Handler="alert ('Ainda não Está Removendo')" />
                        </Listeners>
                    </ext:Button>
                   <ext:ToolbarSeparator />
                    <ext:Button ID="btRealizado" runat="server" Text="Realizado" Icon="Accept">
                        <Listeners>
                            <Click Handler="alert ('Ainda não Está ')" />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </TopBar>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column ColumnID="colTitulo" Header="Título" DataIndex="titulo" />
                <ext:Column ColumnID="colDataCompromisso" Header="Data Compromisso" DataIndex="data" />
                <ext:Column ColumnID="colHoraInicio" Header="Hora Inicio" DataIndex="horainicio" />
                <ext:Column ColumnID="colHoraFim" Header="Hora Fim" DataIndex="horafim" />
                <ext:Column ColumnID="colDescricao" Header="Descrição" DataIndex="descricao" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true"  />
        </SelectionModel>
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="20" />
        </BottomBar>
        <LoadMask ShowMask="true" />
    </ext:GridPanel>
    <ext:Window ID="WindowsNovoAgendaCompromisso" runat="server" Icon="WorldAdd" Title="Dados do Compromisso"
        Hidden="true" Modal="true" Width="530" AutoHeight="true" Resizable="false">
        <Items>
            <ext:FormPanel ID="FormNovoAgendaCompromisso" runat="server" Padding="5" Layout="Anchor"
                BodyStyle="background-color: transparent;" Header="false">
                <Items>
                    <ext:TextField ID="txtTitulo" runat="server" FieldLabel="Título" AnchorHorizontal="93%"
                        AllowBlank="false" MsgTarget="Side" />
                    <ext:DateField ID="dtData" runat="server" Vtype="daterange" FieldLabel="Data" AnchorHorizontal="50%">
                        <CustomConfig>
                            <ext:ConfigItem Name="endDateField" Value="#{DateField2}" Mode="Value" />
                        </CustomConfig>
                    </ext:DateField>
                    <ext:CompositeField ID="CompositeField1" runat="server" MsgTarget="Side" AnchorHorizontal="97%"
                        FieldLabel="Início/Término" DefaultFlex="1">
                        <Items>
                            <ext:TimeField ID="hrInicio" runat="server" MinTime="0:00" MaxTime="23:00" Increment="30"
                                SelectedTime="08:00" Format="H:mm" AnchorHorizontal="40%" />
                            <ext:TimeField ID="hrFim" runat="server" MinTime="0:00" MaxTime="23:00" Increment="30"
                                SelectedTime="08:00" Format="H:mm" AnchorHorizontal="40%" />
                        </Items>
                    </ext:CompositeField>
                    <ext:TextArea ID="txtDescricaoCompromisso" runat="server" FieldLabel="Descrição"
                        AnchorHorizontal="93%" AllowBlank="true" MsgTarget="Side" />
                </Items>
                <Buttons>
                    <ext:Button ID="btGravarAgendaCompromisso" runat="server" Text="Gravar" Icon="Disk">
                        <Listeners>
                            <%-- <Click Handler="Ext.net.DirectMethods.inserir();" />--%>
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="btCancelar" runat="server" Text="Cancelar" Icon="Cancel">
                        <Listeners>
                            <Click Handler="#{WindowsNovoAgendaCompromisso}.hide();" />
                        </Listeners>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
        </Items>
        <Listeners>
            <%--<Close Handler="Ext.net.DirectMethods.limparCampo();" />
            <Hide Handler="Ext.net.DirectMethods.limparCampo();" />--%>
        </Listeners>
    </ext:Window>
</asp:Content>
